package gimys;

import org.newdawn.slick.*;
import org.newdawn.slick.geom.*;

public class Prince extends Animal {

	private float radiusDetection;
	private float radiusAttack;

	private int seductionEventTimer;

	public Prince(Point pLocation) throws SlickException {
		super(pLocation, Skin.PRINCE, new Path(pLocation));
		this.deltaYSprite = -16;
		this.sprite = new SpriteSheet("data/Prince.png", 16, 32);
		this.collisionShape = new Circle(pLocation.x+8, pLocation.y+8, 8);
		this.radiusDetection = 80;
		this.radiusAttack = this.radiusDetection/2;

		this.type = Type.PRINCE;
		this.seductionEventTimer = 0;
	}


	/***** EVENTS *****/


	/**
	 * Called when break heart is clicked on this animal
	 */
	public boolean breakHeartEventHandler(Player player) {
		return false;
	}

	/**
	 * Called when get seduced is clicked on this animal
	 */
	public boolean getSeducedEventHandler(Player player) {
		//System.out.println("seducing prince");
		if (this.seductionEventTimer > 3000) {
			// Try to copy the skin
			//System.out.println("Attempt to get Seduced");
			if (player.useSeductionLevel(25)) {
				this.seductionEventTimer = 0;
				//System.out.println("ctrl");
				return true;
			}
			// Not enough seduction power
			else {
				return false;
			}
		}
		else {
			return false;
		}	
	}

	/***** GETTER AND SETTERS *****/

	public float getRadiusDetection() {
		return this.radiusDetection;
	}

	public float getRadiusAttack() {
		return this.radiusAttack;
	}

	public Image getImage() {
		return this.sprite.getSubImage(0,0);
	}

}
